classdef Signal < handle

properties
	Name;
	CarrierFrequency;
	BitPeriod;
end % end of properties

methods
	function obj = Signal(Name)
        obj.Name = Name;
%		if (nargin > 0)
%			obj.Name = Name;
%		else
%			error('Number of arguments must be 1')
%		end
	end

	function obj = set.Name(obj, val)
		switch (val)
			case 'E5'
				obj.BitPeriod = 20e-3;
				obj.CarrierFrequency = 1191.795e6;
			case 'E5a'
				obj.BitPeriod = 20e-3;
				obj.CarrierFrequency = 1176.450e6;
			case 'E5aI'
				obj.BitPeriod = 20e-3;
				obj.CarrierFrequency = 1176.450e6;
			case 'E5aQ'
				obj.BitPeriod = 20e-3;
				obj.CarrierFrequency = 1176.450e6;
			case 'E5b'
				obj.BitPeriod = 4e-3;
				obj.CarrierFrequency = 1207.140e6;
			case 'E5bI'
				obj.BitPeriod = 4e-3;
				obj.CarrierFrequency = 1207.140e6;
			case 'E5bQ'
				obj.BitPeriod = 4e-3;
				obj.CarrierFrequency = 1207.140e6;
			case 'E1'
				obj.BitPeriod = 4e-3;
				obj.CarrierFrequency = 1575.420e6;
			case 'E1b'
				obj.BitPeriod = 4e-3;
				obj.CarrierFrequency = 1575.420e6;
			case 'E1c'
				obj.BitPeriod = 4e-3;
				obj.CarrierFrequency = 1575.420e6;
			case 'B1'
				obj.BitPeriod = 2e-3;
				obj.CarrierFrequency = 1561.098e6;
			otherwise
				error('Unknown signal')
		end
		obj.Name = val;
	end
end % end of methods

end % end of class
